from obspy import read,read_events,read_inventory
from GetFileLocation import *

def getEventCatalog(projectLocation):
    s=GetFileLocation(projectLocation)
    events=read_events()
    events.clear()
    for event in s.geventsLocation:
        quakeXMLPath = "/".join((event, event.split("/")[-2] + ".xml"))
        events+=read_events(quakeXMLPath,format="QUAKEML")
    return events
def getStream(files):
    st=read()
    st.clear()
    for file in files:
        st+=read(file)
    return st
def getInventory(files):
    inv=read_inventory()
    inv=inv.remove()
    for file in files:
        inv+=read_inventory(file)
    return inv